export default {
  namespaced: true,

  state: () => ({
    statusbarHeight: 0,
    bar_topHeight: 0,
    bangs_Height: 0,
    screen_Width: 0
  }),

  mutations: {
    // 自定义导航栏
    customNavigation(state) {
      const {
        top,
        height
      } = uni.getMenuButtonBoundingClientRect()
      uni.getSystemInfo({
        success(res) {
          state.statusbarHeight = res.statusBarHeight
          state.bar_topHeight = (top - res.statusBarHeight) * 2 + height
          if (res.safeAreaInsets.bottom !== 0) {
            state.bangs_Height = res.safeAreaInsets.bottom
          }
          state.screen_Width = res.screenWidth
        }
      })
    }
  }
}